
extends Node
func _init():
	pass

func loadBuff(name, lv = 0):
	if lv > 0:
		return get(name).new(lv)
	return get(name).new()

const specCellDic = {
	"chaofeng":{"desc": "该单元格上的角色每5秒嘲讽周围2格的单位", "rect": Vector2(-35, -80), "scale": Vector2(1.3, 1.3)},
	"hudun":{"desc": "回合开始时，该单元格上的角色获得血上限100%的护盾", "rect": Vector2(-35, -80), "scale": Vector2(1.3, 1.3)},
	"fuhuo":{"desc": "回合开始时，该单元格上的角色死亡后可以满血复活", "rect": Vector2(-35, -80), "scale": Vector2(1.3, 1.3)},
	"jianshang":{"desc": "回合开始时，该单元格上的角色获得20%减伤", "rect": Vector2(-35, -80), "scale": Vector2(1.3, 1.3)},
	"juji":{"desc": "回合开始时，该单元格上的角色提高8点射程", "rect": Vector2(-35, -80), "scale": Vector2(1.3, 1.3)},
	"sugong":{"desc": "回合开始时，该单元格上的角色获得30%射速", "rect": Vector2(-35, -80), "scale": Vector2(1.3, 1.3)},
	"gongji":{"desc": "回合开始时，该单元格上的角色获得提高15%炮击/雷击/航空", "rect":Vector2(-35, -80), "scale": Vector2(1.3, 1.3)},
	"qiangji":{"desc": "回合开始时，该单元格上的角色对其当前目标造成[炮击雷击之和*3]的技能伤害", "rect": Vector2(-35, -80), "scale": Vector2(1.3, 1.3)},
	"nianfu":{"desc": "该单元格上的角色20秒内无法移动，每秒损失5%的血量，对周围2格的敌人造成损血量150%的技能伤害", "rect": Vector2(-35, -80), "scale": Vector2(1.3, 1.3)},
	"weixiu":{"desc": "该单元格上的角色每秒恢复5%血量", "rect": Vector2(0, 0), "scale": Vector2(0, 0)},
	"shuilei":{"desc": "本回合第一个经过该单元格的单位会损失50%血量", "rect": Vector2(0, 0), "scale": Vector2(0, 0)},
	"judu":{"desc": "经过该单元格上的角色4秒内无法移动，每秒获得2层<剧毒>", "rect": Vector2(0, 0), "scale": Vector2(0, 0)},
	"rongyan":{"desc": "经过该单元格上的角色4秒内无法移动，每秒获得2层<灼烧>", "rect": Vector2(0, 0), "scale": Vector2(0, 0)},
	"shuangdong":{"desc": "经过该单元格上的角色4秒内无法移动，每秒获得3层<霜冻>", "rect": Vector2(0, 0), "scale": Vector2(0, 0)},
	"yueqian":{"desc": "回合开始时，该单元格上的角色会尝试突进到敌方最后排", "rect": Vector2(-35, -80), "scale": Vector2(1.3, 1.3)},
	"lengque":{"desc": "回合开始时，该单元格上的角色的所有技能恢复一半的冷却(单个技能恢复的冷却时间不超过6秒)", "rect": Vector2(-35, -80), "scale": Vector2(1.3, 1.3)}
}

#嘲讽
class b_map_chaoFeng:
	extends "../azurlane_ctrl/AzurBuff.gd"
	func _init():
		attInit()
		dispel = 2
		buffName = "地形：嘲讽"
		id = "b_map_chaoFeng"	
	var index = 0
	func _upS():
		index += 1
		if index >= 5:
			index = 0
			for cha in masCha.getCellChas(masCha.cell, 2, 1):
				masCha.castBuff(cha, buff.b_chaoFeng.new(5))
				cha.aiCha = masCha
			
#复活
class b_map_fuHuo:
	extends "../azurlane_ctrl/AzurBuff.gd"
	func _init():
		attInit()
		dispel = 2
		buffName = "地形：复活"
		id = "b_map_fuHuo"	
	func _connect():
		._connect()
		masCha.connect("onDeath", self, "onDeath")
	func onDeath(atkInfo):
		if masCha.isDeath:
			masCha.isDeath = false
			masCha.healCha(masCha, masCha.att.maxHp)

#攻击
class b_map_gongJi:
	extends "../azurlane_ctrl/AzurBuff.gd"
	func _init():
		attInit()
		dispel = 2
		buffName = "地形：攻击"
		id = "b_map_gongJi"	
		att.atkL = 0.15
		att.mgiAtkL = 0.15
		att.airL = 0.15